home *** CD-ROM | disk | FTP | other *** search
/ Hardcore Visual Basic 5.0 (2nd Edition) / Hardcore Visual Basic 5.0 - Second Edition (1997)(Microsoft Press).iso / Code / TPaths.Frm < prev    next >
Text File  |  1997-06-14  |  2KB  |  82 lines

  1. VERSION 5.00
  2. Begin VB.Form FTestPaths 
  3.    AutoRedraw      =   -1  'True
  4.    Caption         =   "Test Paths"
  5.    ClientHeight    =   3165
  6.    ClientLeft      =   2175
  7.    ClientTop       =   1755
  8.    ClientWidth     =   5850
  9.    DrawWidth       =   2
  10.    FillColor       =   &H00000080&
  11.    FillStyle       =   4  'Upward Diagonal
  12.    BeginProperty Font 
  13.       Name            =   "Lucida Console"
  14.       Size            =   8.25
  15.       Charset         =   0
  16.       Weight          =   400
  17.       Underline       =   0   'False
  18.       Italic          =   0   'False
  19.       Strikethrough   =   0   'False
  20.    EndProperty
  21.    Icon            =   "TPaths.frx":0000
  22.    LinkTopic       =   "Form1"
  23.    PaletteMode     =   1  'UseZOrder
  24.    ScaleHeight     =   3165
  25.    ScaleWidth      =   5850
  26.    ShowInTaskbar   =   0   'False
  27. End
  28. Attribute VB_Name = "FTestPaths"
  29. Attribute VB_GlobalNameSpace = False
  30. Attribute VB_Creatable = False
  31. Attribute VB_PredeclaredId = True
  32. Attribute VB_Exposed = False
  33. Option Explicit
  34.  
  35. Private Sub Form_Load()
  36.     Show
  37.     ' Start recording path
  38.     BeginPath hDC
  39.     ' Do some draw operations
  40.     ForeColor = vbYellow
  41.     FillColor = vbRed
  42.     FillStyle = vbSolid
  43.     Line (ScaleWidth * 0.2, ScaleHeight * 0.3)- _
  44.          (ScaleWidth * 0.8, ScaleHeight * 0.7)
  45.     Circle (ScaleWidth * 0.5, ScaleHeight * 0.5), _
  46.            ScaleHeight * 0.3
  47.     ' Stop recording path
  48.     EndPath hDC
  49.     ' Do something to finished path
  50.     StrokeAndFillPath hDC
  51.     ' Update device context
  52.     Refresh
  53.     
  54.     BeginPath hDC
  55.     Circle (1000, 1000), 500
  56.     EndPath hDC
  57.     'WidenPath hDC
  58.     FlattenPath hDC
  59.     'StrokePath hDC
  60.     FillPath hDC
  61.     'StrokeAndFillPath hDC
  62.     Refresh
  63.     
  64.     ' Set a large, TrueType font
  65.     With Font
  66.         .Name = "Lucida Console"
  67.         .Bold = True
  68.         .Italic = True
  69.         .Size = 48
  70.     End With
  71.     ForeColor = vbGreen
  72.     FillColor = vbMagenta
  73.     FillStyle = vbDiagonalCross
  74.     ' Make Print statement into a path, and then fill
  75.     BeginPath hDC
  76.     Print "Hello"
  77.     EndPath hDC
  78.     StrokeAndFillPath hDC
  79.     Refresh
  80.     
  81. End Sub
  82.